﻿<%@ Page Title="Quản lý Menu" Language="C#" MasterPageFile="~/Administrator/Admin.Master" AutoEventWireup="true" CodeBehind="Menu.aspx.cs" Inherits="VNSoft.Administrator.Menu" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        fieldset
        {
            -webkit-border-radius: 5px;
            margin-top: 5px;
            width: 1150px;
        }
        legend
        {
            font-weight: bold;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="pn" runat="server">
        <ContentTemplate>
            <div class="tieude">
                Quản lý Menu</div>
            <div style="width: 1180px; max-height: 450px; margin-top: 10px; overflow: auto;"
                class="wrapper">
                <asp:GridView ID="gvMenu" Width="100%" runat="server" BackColor="White" BorderColor="#CCCCCC"
                    AutoGenerateColumns="false" EmptyDataText="Không có dữ liệu nào" BorderStyle="None"
                    BorderWidth="1px" CellPadding="3" EnableModelValidation="True" OnRowCommand="gvMenu_RowCommand">
                    <Columns>
                        <asp:TemplateField HeaderText="Xóa">
                            <ItemTemplate>
                                <asp:ImageButton ID="lbXoa" runat="server" Width="20px" Height="20px" ImageUrl="~/Administrator/images/delete-24.png"
                                    OnClientClick="return confirm('Bạn chắc chắn muốn xóa ?')" CommandArgument='<%#Eval("MenuID")%>'
                                    Text="Xóa" CommandName="Del" />
                            </ItemTemplate>
                            <ItemStyle Width="10px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Sửa" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:ImageButton ID="lbSua" runat="server" Width="15px" Height="15px" ImageUrl="~/Administrator/images/edit.ico"
                                    CommandArgument='<%#Eval("MenuID")%>' Text="Sửa" CommandName="Select" />
                            </ItemTemplate>
                            <ItemStyle Width="10px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tên menu">
                            <ItemTemplate>
                                <asp:LinkButton Text='<%#Eval("Name") %>' CommandArgument='<%#Eval("MenuID")%>'
                                    CommandName="Select" ID="linkSelect" runat="server"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle CssClass="rows" Width="300px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="MenuParent" HeaderText="Menu cha" />
                        <asp:BoundField DataField="Link" HeaderText="Link" />
                        <asp:BoundField DataField="Postion" HeaderText="Thứ tự hiển thị" HeaderStyle-Width="125px" ItemStyle-Width="125px" ItemStyle-HorizontalAlign="Center" />
                        <asp:TemplateField HeaderText="Hiển thị" HeaderStyle-Width="90px" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Label Text='<%#Eval("Active") %>' ID="lbtt" runat="server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#636363" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066" BackColor="White" />
                    <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                </asp:GridView>
                <asp:HiddenField ID="hdID" runat="server" />
            </div>
            <fieldset>
                <legend>Thông tin menu</legend>
                <table>
                    <tr>
                        <td>
                            Tên menu<br />
                            <asp:TextBox ID="txtTenMenu" runat="server" Width="308px"></asp:TextBox>
                        </td>
                        <td>
                            Menu cha<br />
                            <asp:DropDownList ID="dlMenuCha" DataTextField="Name" DataValueField="MenuID"
                                runat="server" Width="200px">
                            </asp:DropDownList>
                        </td>
                        <td>
                            Đường dẫn<br />
                            <asp:TextBox ID="txtDuongDan" runat="server" Width="308px"></asp:TextBox>
                        </td>
                        <td>
                            Thứ tự hiển thị<br />
                            <asp:TextBox ID="txtViTri" runat="server" Width="100px"></asp:TextBox>
                            <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Custom,Numbers"
                                TargetControlID="txtViTri" ValidChars="." />
                        </td>
                        <td>
                            <br />
                            <asp:CheckBox ID="ckHienThi" runat="server" Text="Hiển thị lên website" Checked="true" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5">
                            <asp:Button ID="btnAdd" runat="server" Text="Thêm mới" Width="100px" CssClass="button3"
                                OnClick="btnAdd_Click" />
                            <asp:Button ID="btnUpdate" runat="server" Text="Cập nhật" Width="100px" CssClass="button3"
                                OnClick="btnUpdate_Click" />
                            <asp:Button ID="btnCancel" runat="server" Text="Hủy bỏ" Width="100px" CssClass="button3"
                                OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                </table>
            </fieldset>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
